# Copyright (c) 2011 SameGoal LLC.
# All Rights Reserved.
# Author: Andy Hochhaus <ahochhaus@samegoal.com>

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

{
  'targets': [
    {
      'target_name': 'comet_chat_demo',
      'type': 'executable',
      'include_dirs': [
        '../../../../..',
        '<(SHARED_INTERMEDIATE_DIR)',
      ],
      'dependencies': [
        'chat_g_js',
        'chat_g_css',
        'chat_static',
        '../comet.gyp:comet',
        '../../../../../base/base.gyp:base',
        '../../../../../third_party/google-glog/glog.gyp:glog',
        '../../../../../third_party/gflags/gflags.gyp:gflags',
        '../../../../../third_party/libcxx/libcxx.gyp:libcxx',
        '../../../../../third_party/libevent/libevent.gyp:libevent',
        '../../../../../third_party/protobuf/protobuf.gyp:protobuf_full_use_sparingly',
      ],
      'sources': [
        'chat.cc',
      ],
    },
    {
      'target_name': 'chat_js',
      'type': 'none',
      'dependencies': [
        '../../../../../third_party/libcxx/libcxx.gyp:libcxx',
        '../../../../../tools/tools.gyp:js',
      ],
      'sources': [
        'chat.js',
      ],
    },
    {
      'target_name': 'chat_g_css',
      'type': '<(library)',
      'include_dirs': [
        '<(SHARED_INTERMEDIATE_DIR)',
      ],
      'dependencies': [
        '../../../../../third_party/libcxx/libcxx.gyp:libcxx',
        '../../../../../tools/tools.gyp:gss',
      ],
      'variables': {
        'embed_only': 1,
      },
      'sources': [
        'chat.gss',
      ],
      'direct_dependent_settings': {
        'variables': {
          'static_files': [ '<(SHARED_INTERMEDIATE_DIR)/<(GYP_FILE_DIR)/g.css', ],
          'js_files': [ '<(SHARED_INTERMEDIATE_DIR)/<(GYP_FILE_DIR)/g.css.map.js', ],
        },
      },
    },
    {
      'target_name': 'chat_g_js',
      'type': '<(library)',
      'include_dirs': [
        '<(SHARED_INTERMEDIATE_DIR)',
      ],
      'dependencies': [
        '../../../../../third_party/libcxx/libcxx.gyp:libcxx',
        '../../../../../tools/tools.gyp:js_compile',
        'chat_g_css',
      ],
      'variables': {
        'embed_only': 1,
        'module_output': [
          '<(SHARED_INTERMEDIATE_DIR)/<(GYP_FILE_DIR)/g.js',
          '<(SHARED_INTERMEDIATE_DIR)/<(GYP_FILE_DIR)/g.js.cc',
          '<(SHARED_INTERMEDIATE_DIR)/<(GYP_FILE_DIR)/orig.g.js',
        ],
      },
      'direct_dependent_settings': {
        'variables': {
          'static_files': [ '<(SHARED_INTERMEDIATE_DIR)/<(GYP_FILE_DIR)/g.js', ],
        },
      },
    },
    {
      'target_name': 'chat_static',
      'type': '<(library)',
      'include_dirs': [
        '<(SHARED_INTERMEDIATE_DIR)',
      ],
      'dependencies': [
        '../../../../../third_party/libcxx/libcxx.gyp:libcxx',
        '../../../../../tools/tools.gyp:htm',
      ],
      'sources': [
        'chat.htm',
      ],
      'variables': {
        'embed_only': 1,
      },
      'direct_dependent_settings': {
        'variables': {
          'static_files': [ '<@(_sources)', ],
        },
      },
    },
  ],
}
